home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
C
/
Applications
/
SML⁄NJ 93+
/
Documentation
/
examples
/
spread
/
semant.sml
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1995-12-30
|
334 b
|
11 lines
|
[
TEXT/R*ch
]
structure Semant : FORMULA =
struct
open Array infix 9 sub
type formula = int array array -> int
fun NUM i = fn a => i
fun CELLREF (e1,e2) = fn a => a sub e1 a sub e2 a
fun BINOP (f,e1,e2) = fn a => f(e1 a, e2 a)
fun IF (e1,e2,e3) = fn a => if e1 a <> 0 then e2 a else e3 a
val eval = fn x => x
end